<template>
	<view class="container">
		<Header>提案工作</Header>

		<view class="content" style="margin: 0px 15px; padding-bottom: 20px;">
			<!-- <view class="content-title">
				{{data.title}}
			</view> -->
			<view class="list-item">
				<label>案由：</label>
				<view class="con">{{data.title}}</view>
			</view>
			<view class="list-item" v-if="data.method != 3">
				<label>提案人：</label>
				<view class="con">{{data.user_name}}</view>
			</view>
			<view class="list-item" v-if="data.method == 3">
				<label>提案单位：</label>
				<view class="con">{{data.proposer}}</view>
			</view>
			<view class="list-item">
				<label>{{ data.method != 3 ? '界别' : '领衔人界别' }}：</label>
				<view class="con">{{data.circles_text}}</view>
			</view>
			<view class="list-item">
				<label>{{ data.method != 3 ? '党派' : '领衔人党派' }}：</label>
				<view class="con">{{data.party_text}}</view>
			</view>
			<view class="list-item">
				<label>提案归类：</label>
				<view class="con">{{data.case_type_text}}</view>
			</view>
			<view class="list-item" v-if="data.method != 3">
				<label>附议人：</label>
				<view class="con">{{data.user_ids_text}}</view>
			</view>
			<view class="list-item" v-if="data.method == 3">
				<label>领衔人：</label>
				<view class="con">{{data.user_name}}</view>
			</view>
			<view class="list-item" v-if="data.method == 3">
				<label>执笔人：</label>
				<view class="con">{{data.writer_text}}</view>
			</view>
			<view class="list-item" v-if="data.method == 3">
				<label>提案组成员：</label>
				<view class="con">{{data.user_ids_text}}</view>
			</view>
			<view class="list-item">
				<label>{{ data.method != 3 ? '提案人电话' : '领衔人电话' }}：</label>
				<view class="con">{{data.mobile}}</view>
			</view>
			<view class="list-item">
				<label>通讯地址：</label>
				<view class="con">{{data.address}}</view>
			</view>
			<!-- <view class="list-item">
				<label>建议办法：</label>
				<view class="con">{{data.propose}}</view>
			</view> -->
			<view>
				<view>提案内容：</view>
				<view style="margin: 5px 0px" v-html="data.content"></view>
			</view>
			<view class="list-item" v-show="data.status_text">
				<label>办理状态：</label>
				<view class="con">{{data.status_text}}</view>
			</view>
			<view class="list-item">
				<label>提交时间：</label>
				<view class="con">{{data.createtime_text}}</view>
			</view>
			<view class="result" v-for="item in data.handle" :key="item.id">
				<view class="result-item time">
					{{item.handle_time}}
				</view>
				<view class="result-item unit">
					<label>办理单位：</label>
					<view class="con">{{item.name}}</view>
				</view>
				<view class="result-item replay">
					<label>答复内容：</label>
					<view class="con">{{item.reply}}</view>
				</view>
			</view>
			<button type="primary" class="btn submit" @click="toPage()" v-if="data.status_text == '已办结'">去评价</button>
		</view>
	</view>
</template>

<script>
	import Header from '../../components/header.vue'
	import request from '../../common/request.js'
	export default {
		components: {
			Header
		},
		data() {
			return {
				id: '',
				data: {}
			}
		},
		onLoad(option) {
			this.id = option.id
		},
		mounted() {
			this.getDetailData()
		},
		methods: {
			getDetailData() {
				request({
					url: '/proposal/detail',
					data: {
						proposal_id: this.id
					},
					method: 'POST'
				}).then(res => {
					if (res.code == 1) {
						this.data = res.data

					} else {
						uni.showToast({
							title: res.msg,
							icon: 'none',
							duration: 2000
						});
					}
				})
			},
			toPage(){
				uni.navigateTo({
					url: `/pages/resumption/evaluate?id=${this.id}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	.result {
		font-size: 14px;
		margin: 15px 0px;
		border-top: 1px solid #e2e2e2;
	}
	.result-item{
		margin: 5px 0px;
		display: flex;
		line-height: 20px;
	}
	.time{
		color: #909090;
		margin: 10px 0px;
	}
	.result-item label{
		width: 70px;
	}
	.result-item .con{
		display: inline-block;
		width: calc(100% - 70px);
		color: #ea5b6a;
	}
	.content{
		font-size: 14px;
		line-height: 24px;
		.list-item{
			padding: 2px 0px;
			display: flex;
			label{
				width: 90px;
			}
			.con{
				display: inline-block;
				width: calc(100% - 90px);
			}
		}
	}
	.content-title {
		font-size: 18px;
		text-align: center;
		margin: 10px 0px;
		font-weight: 600;
		line-height: 28px;
	}


	.btn {
		margin-bottom: 15px;
		font-size: 14px;
		padding: 5px;
		border-radius: 30px;
	}

	.btn.submit {
		background-color: #2668be;
		margin-top: 30px;
	}

</style>